package com.itheima.group;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class GroupReducerTask extends Reducer<OrderBean, NullWritable,OrderBean, NullWritable> {
    @Override
    protected void reduce(OrderBean key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {

        int size=2;
        int len=1;
        for(NullWritable value:values){
            context.write(key,value);
            if(len==size){
                break;
            }
            len++;
        }
    }
}
